const rp = require('request-promise-native')
async function fetchMovie(item) {
    const url = `https://api.douban.com/v2/movie/${item.doubanId}`;
    const res = await rp(url);
    return res;
};
(async () => {
    let movies = [{
            doubanId: 26728669,
            title: '风中有朵雨做的云',
            rate: '7.6',
            poster: 'https://img3.doubanio.com/view/photo/l_ratio_poster/public/p2552522615.jpg'
        },
        {
            doubanId: 5300054,
            title: '波西米亚狂想曲',
            rate: '8.7',
            poster: 'https://img3.doubanio.com/view/photo/l_ratio_poster/public/p2549558913.jpg'
        }
    ]
    movies.map(async movie => {
        let movieData = await fetchMovie(movie);
        try {
            movieData = JSON.parse(movieData);
        } catch (err) {
            console.log(err)
        }
        console.log(movieData)
    })

})()